using System;
using System.IO;

namespace Dojo {
    public class ResolvedFile {
        private string fileName;
        private string path;

        public ResolvedFile(string fileName, string path) {
            this.fileName = fileName;
            this.path = path;
        }

        public string Name {
            get { return fileName; }
        }

        public string FilePath {
            get { return path + Path.DirectorySeparatorChar + fileName; }
        }

        public virtual string Text() {
             return fileText();
        }

        private string fileText() {
            string fileText = string.Empty;
            using(StreamReader reader = File.OpenText(this.FilePath)) {
                fileText = reader.ReadToEnd();
            }
            return fileText;
        }
    }
}